<template>
  <!-- 大事记 -->
  <a-timeline>
    <a-timeline-item>
      <a-row>
        <a-col :span="4">
          <h4>公司上市</h4>
          <p>2000-01-01</p>
        </a-col>
        <a-col :span="20">
          <a-row>
            <a-col :span="24">
              <p>
                百度一直秉承着“科技为更好”的社会责任理念，坚持运用创新技术，聚焦于解决社会问题。
              </p>
            </a-col>
            <a-col :span="24">
              <a-upload
                list-type="picture-card"
                :file-list="fileList2"
                :onPreview="handlePreview"
                :onChange="handleChange"
              >
                <template v-if="fileList2.length < 4">
                  <a-button> <a-icon type="upload" /> 添加文件 </a-button>
                </template>
              </a-upload>
            </a-col>
          </a-row>
        </a-col>
      </a-row>
    </a-timeline-item>
    <a-timeline-item>
      <a-button type="dashed" @click="addNewItem">+ 继续添加</a-button>
    </a-timeline-item>
  </a-timeline>
</template>

<script>
export default {
  name: 'CompanyTimeline',
  data() {
    return {
      fileList2: [
        {
          uid: '-1',
          name: '公司施工图1',
          status: 'done',
          url: 'https://example.com/company_image1.png'
        },
        {
          uid: '-2',
          name: '公司施工图2',
          status: 'done',
          url: 'https://example.com/company_image2.png'
        },
        {
          uid: '-3',
          name: '公司商标',
          status: 'done',
          url: 'https://example.com/company_logo.png'
        }
      ]
    }
  },
  methods: {
    handlePreview(file) {
      this.previewImage = file.url || file.thumbUrl
      this.previewVisible = true
    },
    handleChange({ fileList }) {
      this.fileList1 = fileList
    },
    addNewItem() {
      // 添加新的时间节点逻辑
      console.log('添加新的时间节点')
    }
  }
}
</script>
